#include<iostream>
#include<algorithm>
using namespace std;
int n;
int main()
{
	cin >> n;
	int ans = 0;
	int x;
	for (int i = 1; i <= n; i++) {
		cin >> x;
		ans = max(ans, x + i - 1);
	}
	cout << ans << endl;
	return 0;
}